define(["config","App"],function(config,App){ 
    var _init = function(path){
        var router = config.router;
        var not_in_conf = true;
        for(i in router){
            if(i == path){
                not_in_conf = false;
                param = JSON.stringify(arguments);
                router[i](param);
            }
        }
        if(not_in_conf){
            App.component(path);
        }
    }
    return {
        router:function(){
            var path = App.hash("page")?App.hash("page"):App.param("page");
            if(path){
                _init(path);
            }else{
				_init(config.default_router);
			}
        },
        load:function(path,param){
            _init(path,param);
        }
    };
})